export default async function errorHandle(ctx, next) {
  await next().catch((error) => {
    console.warn('error', error)
    ctx.status = error.status || 500
    ctx.body = {
      message: 'Error',
      errors: error.toString()
    }
  })
}